package org.example.controller.en;

import org.example.service.api.en.DepositEnServiceInterface;
import org.example.util.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@Controller
@CrossOrigin

public class DepositTbEnController {
    @Autowired
    @Qualifier("depositEnServiceInterfaceImpl")
    DepositEnServiceInterface depositEnService;

    @GetMapping("/queryDepositInfoById")
    public PageList queryDepositInfoById(Integer depositId,Integer page,Integer pageSize ){
        PageList depositTbList=depositEnService.queryDepositInfoById(depositId,page,pageSize);
        return depositTbList;
    }

    @GetMapping("/queryDepositInfoByUserId")
    public PageList queryDepositInfoByUserId(Integer userId, Integer page, Integer pageSize) {
            PageList pageList= depositEnService.queryDepositInfoByUserId(userId,page,pageSize);
            return  pageList;
    }

    @GetMapping("/queryDepositInfoByDormitoryId")
    public PageList queryDepositInfoByDormitoryId(Integer dormitoryId,Integer page,Integer pageSize ){
        PageList  pageList = depositEnService.queryDepositInfoByDormitoryId(page,pageSize,dormitoryId);
        return pageList;
    }

    @GetMapping("/adminQueryUserInfoLike")
    public PageList adminQueryUserInfoLike(String condition,Integer page,Integer pageSize){
        PageList pageList = depositEnService.queryUserInfoByLike(condition,page,pageSize);
        return pageList;
    }

}
